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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.v: D = None
        self.r: D = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.v: D = None
        self.r: D = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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