class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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