class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.w: E = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
b = D("b")
g = E("g")
h = F("h")
i = B("i")
n = E("n")
k = B("k")
d = D("d")

a.r = g
a.u = h
a.o = k
m.r = a
m.v = k
m.t = l
m.w = l
m.u = n
l.s = h
l.u = h
l.v = g
b.u = h
b.q = d
b.w = g
b.t = l
b.z = m
g.r = d
h.x = d
h.t = d
h.r = m
h.s = n
i.r = a
i.v = m
i.t = l
i.w = l
i.u = n
n.r = d
k.r = a
k.v = m
k.t = l
k.w = l
k.u = n
d.u = h
d.q = b
d.w = g
d.t = l
d.z = i
assert d.t.u.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.w: E = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
b = D("b")
g = E("g")
h = F("h")
i = B("i")
n = E("n")
k = B("k")
d = D("d")

a.r = g
a.u = h
a.o = k
m.r = a
m.v = k
m.t = l
m.w = l
m.u = n
l.s = h
l.u = h
l.v = g
b.u = h
b.q = d
b.w = g
b.t = l
b.z = m
g.r = d
h.x = d
h.t = d
h.r = m
h.s = n
i.r = a
i.v = m
i.t = l
i.w = l
i.u = n
n.r = d
k.r = a
k.v = m
k.t = l
k.w = l
k.u = n
d.u = h
d.q = b
d.w = g
d.t = l
d.z = i
assert d.t.u.r.r.txt == "a"