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

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

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

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

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

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

b = A("b")
m = B("m")
g = C("g")
k = D("k")
i = E("i")
h = F("h")
j = F("j")
e = F("e")
d = F("d")

b.w = d
b.p = i
m.v = g
m.p = k
m.y = i
g.w = b
k.q = i
k.v = g
k.p = g
i.t = e
i.u = k
i.p = k
i.y = j
h.o = m
j.o = m
e.o = m
d.o = m
assert e.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
m = B("m")
g = C("g")
k = D("k")
i = E("i")
h = F("h")
j = F("j")
e = F("e")
d = F("d")

b.w = d
b.p = i
m.v = g
m.p = k
m.y = i
g.w = b
k.q = i
k.v = g
k.p = g
i.t = e
i.u = k
i.p = k
i.y = j
h.o = m
j.o = m
e.o = m
d.o = m
assert e.o.y.t.txt == "e"