class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.y: C = None
        self.w: E = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.p: C = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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

b.r = c
b.u = c
b.q = f
b.y = e
b.w = j
m.o = c
m.r = c
e.q = j
n.v = f
n.w = e
j.z = c
j.v = c
j.s = m
j.p = e
j.q = n
c.z = e
c.y = e
c.p = m
a.v = i
a.w = e
f.o = c
f.r = c
i.o = c
i.r = c
d.r = c
d.u = c
d.q = f
d.y = e
d.w = j
assert c.p.r.z.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.y: C = None
        self.w: E = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.p: C = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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

b.r = c
b.u = c
b.q = f
b.y = e
b.w = j
m.o = c
m.r = c
e.q = j
n.v = f
n.w = e
j.z = c
j.v = c
j.s = m
j.p = e
j.q = n
c.z = e
c.y = e
c.p = m
a.v = i
a.w = e
f.o = c
f.r = c
i.o = c
i.r = c
d.r = c
d.u = c
d.q = f
d.y = e
d.w = j
assert c.p.r.z.q.p.txt == "e"