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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: G = None
        self.y: E = None
        self.p: F = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

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

k.u = n
k.t = b
k.s = b
k.r = b
k.z = h
k.y = h
k.o = i
k.x = c
k.p = f
k.q = l
c.q = i
c.w = n
n.z = i
n.t = f
i.u = l
d.u = h
d.x = b
f.w = b
f.q = b
f.s = l
f.v = h
f.z = c
f.u = c
f.x = n
f.o = n
f.r = i
l.z = g
b.x = h
b.o = d
b.u = f
h.p = i
g.r = l
g.w = l
g.y = d
g.p = f
g.t = f
g.v = f
assert f.v.p.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: H = None
        self.s: H = None
        self.z: I = None
        self.o: D = None
        self.r: H = None
        self.x: B = None
        self.p: F = None
        self.y: I = None
        self.q: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: G = None
        self.y: E = None
        self.p: F = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

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

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