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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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