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

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

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

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

i = A("i")
n = B("n")
c = C("c")
l = D("l")
m = A("m")
b = C("b")

i.t = c
i.w = l
i.r = n
i.u = m
n.o = l
n.p = b
n.r = b
c.q = n
c.s = b
l.v = b
l.w = b
l.x = m
m.t = b
m.w = l
m.r = n
m.u = i
b.q = n
b.s = c
assert i.t.s.s.q.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

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

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

i = A("i")
n = B("n")
c = C("c")
l = D("l")
m = A("m")
b = C("b")

i.t = c
i.w = l
i.r = n
i.u = m
n.o = l
n.p = b
n.r = b
c.q = n
c.s = b
l.v = b
l.w = b
l.x = m
m.t = b
m.w = l
m.r = n
m.u = i
b.q = n
b.s = c
assert i.t.s.s.q.o.v.txt == "b"