class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.o: F = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.o: C = None
        self.p: C = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.txt = txt

n = A("n")
j = B("j")
a = C("a")
c = D("c")
l = E("l")
g = F("g")
f = G("f")
k = E("k")
h = A("h")
m = D("m")

n.x = a
n.z = f
n.p = f
n.o = g
j.r = a
a.z = k
c.v = m
l.x = h
l.u = g
l.o = a
l.p = a
l.z = n
l.r = f
g.t = a
g.y = a
g.u = m
f.w = k
f.q = a
k.x = h
k.z = h
k.u = g
k.o = a
k.p = a
k.r = f
h.x = a
h.z = f
h.p = f
h.o = g
m.v = c
assert f.w.o.z.z.p.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.o: F = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.o: C = None
        self.p: C = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.txt = txt

n = A("n")
j = B("j")
a = C("a")
c = D("c")
l = E("l")
g = F("g")
f = G("f")
k = E("k")
h = A("h")
m = D("m")

n.x = a
n.z = f
n.p = f
n.o = g
j.r = a
a.z = k
c.v = m
l.x = h
l.u = g
l.o = a
l.p = a
l.z = n
l.r = f
g.t = a
g.y = a
g.u = m
f.w = k
f.q = a
k.x = h
k.z = h
k.u = g
k.o = a
k.p = a
k.r = f
h.x = a
h.z = f
h.p = f
h.o = g
m.v = c
assert f.w.o.z.z.p.w.u.txt == "g"