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

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

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

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

j = A("j")
e = B("e")
i = C("i")
k = D("k")
b = B("b")
g = C("g")
l = D("l")
d = A("d")
n = B("n")

j.q = e
j.t = i
j.v = l
e.t = g
e.q = b
i.w = n
i.y = e
k.r = l
k.p = g
b.t = i
b.q = e
g.w = b
g.y = b
l.r = k
l.p = i
d.q = e
d.t = i
d.v = l
n.t = g
n.q = e
assert l.p.y.t.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.v: D = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
i = C("i")
k = D("k")
b = B("b")
g = C("g")
l = D("l")
d = A("d")
n = B("n")

j.q = e
j.t = i
j.v = l
e.t = g
e.q = b
i.w = n
i.y = e
k.r = l
k.p = g
b.t = i
b.q = e
g.w = b
g.y = b
l.r = k
l.p = i
d.q = e
d.t = i
d.v = l
n.t = g
n.q = e
assert l.p.y.t.w.t.txt == "i"