class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: B = None
        self.u: H = None
        self.s: C = None
        self.r: D = None
        self.w: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: A = None
        self.q: G = None
        self.x: F = None
        self.o: A = None
        self.r: H = None
        self.u: H = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: E = None
        self.z: E = None
        self.w: F = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: A = None
        self.q: G = None
        self.x: F = None
        self.o: A = None
        self.r: H = None
        self.u: H = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: E = None
        self.z: E = None
        self.w: F = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.r: E = None
        self.txt = txt

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

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