class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.q: F = None
        self.p: C = None
        self.r: E = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: F = None
        self.y: G = None
        self.t: A = None
        self.z: G = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.u: A = None
        self.p: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.q: A = None
        self.txt = txt

a = A("a")
k = B("k")
g = C("g")
b = D("b")
m = E("m")
j = F("j")
c = G("c")
n = F("n")
l = G("l")

a.u = m
a.r = m
a.y = m
a.v = b
a.x = b
a.q = j
a.p = g
k.o = m
k.s = j
k.y = c
k.z = c
k.t = a
k.u = l
g.q = b
b.w = n
b.o = k
b.u = a
b.p = c
m.q = g
m.w = b
j.z = m
j.w = k
j.v = k
j.t = g
c.s = k
c.u = l
c.q = a
n.z = m
n.w = k
n.v = k
n.t = g
l.s = k
l.u = c
l.q = a
assert a.x.u.p.q.w.v.o.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.q: F = None
        self.p: C = None
        self.r: E = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: F = None
        self.y: G = None
        self.t: A = None
        self.z: G = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.u: A = None
        self.p: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.q: A = None
        self.txt = txt

a = A("a")
k = B("k")
g = C("g")
b = D("b")
m = E("m")
j = F("j")
c = G("c")
n = F("n")
l = G("l")

a.u = m
a.r = m
a.y = m
a.v = b
a.x = b
a.q = j
a.p = g
k.o = m
k.s = j
k.y = c
k.z = c
k.t = a
k.u = l
g.q = b
b.w = n
b.o = k
b.u = a
b.p = c
m.q = g
m.w = b
j.z = m
j.w = k
j.v = k
j.t = g
c.s = k
c.u = l
c.q = a
n.z = m
n.w = k
n.v = k
n.t = g
l.s = k
l.u = c
l.q = a
assert a.x.u.p.q.w.v.o.w.u.txt == "a"