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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

c.r = i
c.o = g
c.t = b
i.q = h
b.o = f
b.x = f
b.r = k
b.p = k
b.t = c
b.w = i
b.u = h
l.o = c
l.s = c
l.p = k
f.z = c
g.u = i
g.q = k
g.w = c
h.s = c
k.w = l
k.z = l
k.p = c
k.y = b
k.r = i
assert f.z.t.p.r.q.txt == "h"