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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
k = C("k")
f = D("f")
m = A("m")
c = D("c")
b = C("b")

e.w = l
e.t = m
e.u = m
e.y = m
l.q = e
l.r = m
k.u = f
k.t = f
k.s = l
k.q = c
f.y = c
f.s = b
m.w = l
m.t = e
m.u = e
m.y = e
c.y = f
c.s = k
b.u = c
b.t = f
b.q = f
b.s = l
assert l.r.t.w.q.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
k = C("k")
f = D("f")
m = A("m")
c = D("c")
b = C("b")

e.w = l
e.t = m
e.u = m
e.y = m
l.q = e
l.r = m
k.u = f
k.t = f
k.s = l
k.q = c
f.y = c
f.s = b
m.w = l
m.t = e
m.u = e
m.y = e
c.y = f
c.s = k
b.u = c
b.t = f
b.q = f
b.s = l
assert l.r.t.w.q.t.w.txt == "l"