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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.txt = txt

e = A("e")
c = B("c")
n = C("n")
l = D("l")
d = E("d")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.txt = txt

e = A("e")
c = B("c")
n = C("n")
l = D("l")
d = E("d")
f = F("f")

e.y = c
e.u = c
e.r = l
e.w = l
e.t = d
c.x = f
c.s = e
c.t = d
n.v = l
n.r = l
n.p = d
n.u = f
n.t = c
l.t = c
l.u = f
d.w = n
d.p = e
f.w = e
f.y = l
assert f.y.t.x.w.t.w.txt == "n"