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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.o: C = None
        self.w: D = None
        self.s: F = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.v: A = None
        self.w: A = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

e = A("e")
c = B("c")
m = C("m")
n = D("n")
b = E("b")
j = F("j")
h = G("h")
l = C("l")
d = D("d")
a = B("a")

e.r = l
e.p = l
c.u = l
c.r = j
c.t = j
c.z = j
c.q = j
c.x = n
m.u = b
n.u = d
n.w = d
n.q = l
n.o = l
n.s = j
n.x = j
b.o = a
b.r = e
j.v = e
h.t = b
h.z = e
h.v = e
h.w = e
h.s = l
h.x = j
l.u = b
d.u = n
d.w = n
d.q = l
d.o = m
d.s = j
d.x = j
a.u = l
a.r = j
a.t = j
a.z = j
a.q = j
a.x = d
assert a.u.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.o: C = None
        self.w: D = None
        self.s: F = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.v: A = None
        self.w: A = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

e = A("e")
c = B("c")
m = C("m")
n = D("n")
b = E("b")
j = F("j")
h = G("h")
l = C("l")
d = D("d")
a = B("a")

e.r = l
e.p = l
c.u = l
c.r = j
c.t = j
c.z = j
c.q = j
c.x = n
m.u = b
n.u = d
n.w = d
n.q = l
n.o = l
n.s = j
n.x = j
b.o = a
b.r = e
j.v = e
h.t = b
h.z = e
h.v = e
h.w = e
h.s = l
h.x = j
l.u = b
d.u = n
d.w = n
d.q = l
d.o = m
d.s = j
d.x = j
a.u = l
a.r = j
a.t = j
a.z = j
a.q = j
a.x = d
assert a.u.u.o.u.txt == "l"