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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: C = None
        self.q: D = None
        self.z: D = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.x: B = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

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

j.w = d
m.o = d
m.y = e
m.p = e
k.q = e
d.o = j
d.q = k
e.t = i
e.o = k
e.q = d
e.z = d
e.x = m
e.w = j
i.w = m
i.x = m
i.p = e
i.v = e
i.s = e
assert e.x.y.o.q.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: C = None
        self.q: D = None
        self.z: D = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.x: B = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

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

j.w = d
m.o = d
m.y = e
m.p = e
k.q = e
d.o = j
d.q = k
e.t = i
e.o = k
e.q = d
e.z = d
e.x = m
e.w = j
i.w = m
i.x = m
i.p = e
i.v = e
i.s = e
assert e.x.y.o.q.o.q.txt == "e"