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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.w: A = None
        self.q: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: B = None
        self.t: C = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.w: A = None
        self.q: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: B = None
        self.t: C = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

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