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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

f.x = k
f.w = d
f.z = n
d.u = f
e.w = f
e.u = l
e.r = l
e.p = b
e.q = b
e.x = k
e.y = c
e.z = d
l.o = d
i.q = n
k.o = d
k.q = l
k.r = i
h.o = l
b.y = h
b.p = i
b.w = e
n.o = l
c.w = f
c.u = l
c.r = l
c.p = b
c.q = b
c.x = k
c.y = e
c.z = d
assert k.r.q.o.o.u.x.o.u.txt == "f"