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

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

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

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

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

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

j = A("j")
l = B("l")
f = C("f")
k = D("k")
i = E("i")
c = F("c")
m = D("m")
n = D("n")
b = F("b")

j.w = f
j.x = l
l.v = j
l.r = j
f.x = l
f.q = l
k.p = l
k.r = i
k.t = b
k.o = b
i.t = m
i.u = b
i.z = j
c.w = b
c.p = b
c.r = b
m.p = l
m.r = i
m.t = c
m.o = c
n.p = l
n.r = i
n.t = c
n.o = c
b.w = c
b.p = c
b.r = c
assert c.p.r.p.p.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

j = A("j")
l = B("l")
f = C("f")
k = D("k")
i = E("i")
c = F("c")
m = D("m")
n = D("n")
b = F("b")

j.w = f
j.x = l
l.v = j
l.r = j
f.x = l
f.q = l
k.p = l
k.r = i
k.t = b
k.o = b
i.t = m
i.u = b
i.z = j
c.w = b
c.p = b
c.r = b
m.p = l
m.r = i
m.t = c
m.o = c
n.p = l
n.r = i
n.t = c
n.o = c
b.w = c
b.p = c
b.r = c
assert c.p.r.p.p.w.p.txt == "c"