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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: G = None
        self.s: F = None
        self.t: C = None
        self.y: E = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.w: B = 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.w: A = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.x: D = None
        self.r: C = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: G = None
        self.s: F = None
        self.t: C = None
        self.y: E = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.w: B = 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.w: A = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: D = None
        self.x: D = None
        self.r: C = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

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

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