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

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

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

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

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

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

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

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

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

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

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

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

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

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

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