class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.t: C = None
        self.p: E = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: A = None
        self.q: E = None
        self.s: E = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.v: D = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

i = A("i")
h = B("h")
g = C("g")
k = D("k")
b = E("b")
a = F("a")
e = F("e")
c = F("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: A = None
        self.q: E = None
        self.s: E = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.v: D = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

i = A("i")
h = B("h")
g = C("g")
k = D("k")
b = E("b")
a = F("a")
e = F("e")
c = F("c")

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