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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: F = None
        self.u: G = None
        self.v: D = None
        self.t: E = None
        self.o: D = None
        self.r: G = None
        self.y: H = None
        self.p: C = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: E = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.z: D = None
        self.w: A = None
        self.o: E = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: B = None
        self.u: I = None
        self.q: G = None
        self.txt = txt

g = A("g")
k = B("k")
e = C("e")
c = D("c")
d = E("d")
m = F("m")
i = G("i")
h = H("h")
l = I("l")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: F = None
        self.u: G = None
        self.v: D = None
        self.t: E = None
        self.o: D = None
        self.r: G = None
        self.y: H = None
        self.p: C = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: E = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.z: D = None
        self.w: A = None
        self.o: E = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: B = None
        self.u: I = None
        self.q: G = None
        self.txt = txt

g = A("g")
k = B("k")
e = C("e")
c = D("c")
d = E("d")
m = F("m")
i = G("i")
h = H("h")
l = I("l")
f = J("f")

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