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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: A = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.y: J = None
        self.w: H = None
        self.u: E = None
        self.p: B = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: H = 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.u: D = None
        self.q: A = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.w: C = None
        self.v: I = None
        self.r: H = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: D = None
        self.txt = txt

g = A("g")
a = B("a")
l = C("l")
k = D("k")
m = E("m")
c = F("c")
j = G("j")
d = H("d")
e = I("e")
b = J("b")

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: A = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.y: J = None
        self.w: H = None
        self.u: E = None
        self.p: B = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: H = 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.u: D = None
        self.q: A = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.w: C = None
        self.v: I = None
        self.r: H = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: D = None
        self.txt = txt

g = A("g")
a = B("a")
l = C("l")
k = D("k")
m = E("m")
c = F("c")
j = G("j")
d = H("d")
e = I("e")
b = J("b")

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