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

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

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

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

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

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

c = A("c")
f = B("f")
k = C("k")
d = D("d")
j = E("j")
m = F("m")
b = E("b")
e = F("e")

c.s = m
c.w = b
c.q = d
f.r = c
f.u = e
f.t = d
k.z = e
k.u = f
k.x = f
k.t = c
k.s = j
d.u = f
d.t = j
d.y = e
j.p = f
j.t = d
j.o = m
j.z = k
j.u = k
m.z = e
m.s = c
m.r = c
m.q = j
m.p = j
m.o = d
b.p = f
b.t = d
b.o = m
b.z = k
b.u = k
e.z = m
e.s = c
e.r = c
e.q = b
e.p = b
e.o = d
assert j.o.r.w.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

c = A("c")
f = B("f")
k = C("k")
d = D("d")
j = E("j")
m = F("m")
b = E("b")
e = F("e")

c.s = m
c.w = b
c.q = d
f.r = c
f.u = e
f.t = d
k.z = e
k.u = f
k.x = f
k.t = c
k.s = j
d.u = f
d.t = j
d.y = e
j.p = f
j.t = d
j.o = m
j.z = k
j.u = k
m.z = e
m.s = c
m.r = c
m.q = j
m.p = j
m.o = d
b.p = f
b.t = d
b.o = m
b.z = k
b.u = k
e.z = m
e.s = c
e.r = c
e.q = b
e.p = b
e.o = d
assert j.o.r.w.p.r.txt == "c"