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

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

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

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

g = A("g")
l = B("l")
a = C("a")
n = D("n")
h = C("h")
f = C("f")
e = D("e")
j = A("j")

g.r = l
g.y = l
g.z = h
l.x = j
a.q = g
a.t = g
a.y = n
a.w = f
n.u = e
n.r = e
n.o = a
n.p = j
h.q = j
h.t = g
h.y = n
h.w = a
f.q = j
f.t = g
f.y = n
f.w = a
e.u = n
e.r = n
e.o = a
e.p = j
j.r = l
j.y = l
j.z = h
assert n.u.r.u.r.u.u.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

g = A("g")
l = B("l")
a = C("a")
n = D("n")
h = C("h")
f = C("f")
e = D("e")
j = A("j")

g.r = l
g.y = l
g.z = h
l.x = j
a.q = g
a.t = g
a.y = n
a.w = f
n.u = e
n.r = e
n.o = a
n.p = j
h.q = j
h.t = g
h.y = n
h.w = a
f.q = j
f.t = g
f.y = n
f.w = a
e.u = n
e.r = n
e.o = a
e.p = j
j.r = l
j.y = l
j.z = h
assert n.u.r.u.r.u.u.p.y.txt == "l"