class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: A = None
        self.u: G = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.txt = txt

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

k.o = e
k.x = e
k.z = l
m.p = e
m.u = e
m.t = k
m.w = d
c.y = d
c.o = d
h.y = c
h.p = k
h.z = l
d.y = h
d.z = h
d.r = e
d.q = m
d.t = m
l.o = k
e.s = d
b.u = e
b.o = h
assert b.o.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: A = None
        self.u: G = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.txt = txt

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

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