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

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

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

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

g = A("g")
a = B("a")
j = C("j")
d = D("d")
k = C("k")
i = B("i")
m = A("m")

g.w = d
g.q = d
g.r = i
g.p = j
a.u = j
a.v = j
a.o = d
a.q = d
j.q = d
j.y = k
d.q = k
d.t = j
k.q = d
k.y = j
i.u = j
i.o = d
i.q = d
i.v = k
m.w = d
m.q = d
m.r = i
m.p = k
assert j.q.q.q.q.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.p: C = None
        self.q: D = None
        self.txt = txt

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

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

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

g = A("g")
a = B("a")
j = C("j")
d = D("d")
k = C("k")
i = B("i")
m = A("m")

g.w = d
g.q = d
g.r = i
g.p = j
a.u = j
a.v = j
a.o = d
a.q = d
j.q = d
j.y = k
d.q = k
d.t = j
k.q = d
k.y = j
i.u = j
i.o = d
i.q = d
i.v = k
m.w = d
m.q = d
m.r = i
m.p = k
assert j.q.q.q.q.y.y.y.txt == "j"