class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: E = None
        self.o: C = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.r: E = None
        self.s: G = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: B = None
        self.z: F = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: A = None
        self.x: C = None
        self.q: C = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

l = A("l")
n = B("n")
b = C("b")
c = D("c")
j = E("j")
a = F("a")
e = G("e")
d = E("d")
m = B("m")
f = D("f")

l.w = a
l.z = f
n.t = a
n.v = j
n.o = b
n.p = l
b.q = d
c.p = e
c.s = e
c.u = b
c.r = j
c.q = l
j.q = a
j.z = a
j.y = n
j.s = c
j.u = d
a.r = e
e.u = l
e.v = l
e.x = b
e.q = b
e.o = c
e.p = j
d.q = a
d.z = a
d.y = n
d.s = c
d.u = j
m.t = a
m.v = j
m.o = b
m.p = l
f.p = e
f.s = e
f.u = b
f.r = j
f.q = l
assert b.q.z.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: E = None
        self.o: C = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.r: E = None
        self.s: G = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: B = None
        self.z: F = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: A = None
        self.x: C = None
        self.q: C = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

l = A("l")
n = B("n")
b = C("b")
c = D("c")
j = E("j")
a = F("a")
e = G("e")
d = E("d")
m = B("m")
f = D("f")

l.w = a
l.z = f
n.t = a
n.v = j
n.o = b
n.p = l
b.q = d
c.p = e
c.s = e
c.u = b
c.r = j
c.q = l
j.q = a
j.z = a
j.y = n
j.s = c
j.u = d
a.r = e
e.u = l
e.v = l
e.x = b
e.q = b
e.o = c
e.p = j
d.q = a
d.z = a
d.y = n
d.s = c
d.u = j
m.t = a
m.v = j
m.o = b
m.p = l
f.p = e
f.s = e
f.u = b
f.r = j
f.q = l
assert b.q.z.r.p.txt == "j"