class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.w: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: D = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.y: D = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

a = A("a")
j = B("j")
k = C("k")
e = D("e")
c = E("c")
h = F("h")
l = G("l")
i = G("i")
f = A("f")
d = B("d")

a.t = d
a.z = f
a.w = h
a.o = c
j.p = f
j.o = a
j.w = c
j.s = e
k.v = f
k.r = e
k.t = h
e.o = a
e.q = d
e.w = c
c.q = e
h.r = k
h.o = e
l.x = d
l.w = d
l.y = e
l.z = e
l.s = i
i.x = d
i.w = j
i.y = e
i.z = e
i.s = l
f.t = d
f.z = a
f.w = h
f.o = c
d.p = f
d.o = f
d.w = c
d.s = e
assert l.z.w.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.w: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: D = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.y: D = None
        self.z: D = None
        self.s: G = None
        self.txt = txt

a = A("a")
j = B("j")
k = C("k")
e = D("e")
c = E("c")
h = F("h")
l = G("l")
i = G("i")
f = A("f")
d = B("d")

a.t = d
a.z = f
a.w = h
a.o = c
j.p = f
j.o = a
j.w = c
j.s = e
k.v = f
k.r = e
k.t = h
e.o = a
e.q = d
e.w = c
c.q = e
h.r = k
h.o = e
l.x = d
l.w = d
l.y = e
l.z = e
l.s = i
i.x = d
i.w = j
i.y = e
i.z = e
i.s = l
f.t = d
f.z = a
f.w = h
f.o = c
d.p = f
d.o = f
d.w = c
d.s = e
assert l.z.w.q.o.txt == "a"