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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.z: G = None
        self.y: F = None
        self.o: E = None
        self.r: H = None
        self.q: H = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.r: D = None
        self.q: F = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.w: D = None
        self.t: E = None
        self.q: G = None
        self.p: A = None
        self.y: D = None
        self.txt = txt

f = A("f")
j = B("j")
d = C("d")
k = D("k")
l = E("l")
g = F("g")
m = G("m")
b = H("b")
e = F("e")
a = D("a")

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.z: G = None
        self.y: F = None
        self.o: E = None
        self.r: H = None
        self.q: H = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.r: D = None
        self.q: F = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.w: D = None
        self.t: E = None
        self.q: G = None
        self.p: A = None
        self.y: D = None
        self.txt = txt

f = A("f")
j = B("j")
d = C("d")
k = D("k")
l = E("l")
g = F("g")
m = G("m")
b = H("b")
e = F("e")
a = D("a")

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