class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.p: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: A = None
        self.v: B = None
        self.z: G = None
        self.o: G = None
        self.p: B = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: G = None
        self.q: C = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.z: F = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: A = None
        self.v: B = None
        self.z: G = None
        self.o: G = None
        self.p: B = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: G = None
        self.q: C = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.z: F = None
        self.r: D = None
        self.txt = txt

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

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