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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

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

e.t = k
e.x = g
e.q = g
e.y = l
e.r = l
g.y = l
b.o = d
b.x = e
b.u = m
k.s = g
d.v = n
d.t = m
d.s = k
m.v = j
m.t = d
m.s = n
l.t = j
l.x = g
l.q = g
l.y = e
l.r = e
j.s = g
n.s = g
assert n.s.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: B = None
        self.y: A = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

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

e.t = k
e.x = g
e.q = g
e.y = l
e.r = l
g.y = l
b.o = d
b.x = e
b.u = m
k.s = g
d.v = n
d.t = m
d.s = k
m.v = j
m.t = d
m.s = n
l.t = j
l.x = g
l.q = g
l.y = e
l.r = e
j.s = g
n.s = g
assert n.s.y.q.txt == "g"