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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.x: D = None
        self.v: E = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

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

e = A("e")
k = B("k")
d = C("d")
b = D("b")
m = E("m")
c = F("c")

e.y = c
e.t = m
e.z = m
k.z = b
k.p = b
k.x = b
k.v = m
k.y = d
d.w = e
d.u = e
b.y = k
b.t = d
m.r = c
m.w = d
m.u = d
m.x = d
c.r = d
c.u = k
c.p = m
c.s = m
assert d.w.y.r.w.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.x: D = None
        self.v: E = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

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

e = A("e")
k = B("k")
d = C("d")
b = D("b")
m = E("m")
c = F("c")

e.y = c
e.t = m
e.z = m
k.z = b
k.p = b
k.x = b
k.v = m
k.y = d
d.w = e
d.u = e
b.y = k
b.t = d
m.r = c
m.w = d
m.u = d
m.x = d
c.r = d
c.u = k
c.p = m
c.s = m
assert d.w.y.r.w.y.r.txt == "d"