class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: H = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.z: J = None
        self.t: E = None
        self.p: F = None
        self.y: C = None
        self.q: C = None
        self.w: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.z: E = None
        self.t: B = None
        self.w: C = None
        self.s: A = None
        self.o: I = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: B = None
        self.x: C = None
        self.p: E = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.z: J = None
        self.t: E = None
        self.p: F = None
        self.y: C = None
        self.q: C = None
        self.w: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.z: E = None
        self.t: B = None
        self.w: C = None
        self.s: A = None
        self.o: I = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: B = None
        self.x: C = None
        self.p: E = None
        self.v: B = None
        self.txt = txt

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

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

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