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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

j = A("j")
k = B("k")
e = C("e")
a = D("a")
h = E("h")
l = F("l")
b = C("b")

j.y = b
k.q = b
k.w = h
e.y = l
e.w = h
a.s = k
a.w = k
a.r = b
a.o = j
a.u = j
a.y = j
h.r = l
h.p = l
h.t = e
l.z = b
b.y = l
b.w = h
assert l.z.w.t.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

j = A("j")
k = B("k")
e = C("e")
a = D("a")
h = E("h")
l = F("l")
b = C("b")

j.y = b
k.q = b
k.w = h
e.y = l
e.w = h
a.s = k
a.w = k
a.r = b
a.o = j
a.u = j
a.y = j
h.r = l
h.p = l
h.t = e
l.z = b
b.y = l
b.w = h
assert l.z.w.t.w.t.txt == "e"