class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: F = None
        self.z: G = None
        self.x: F = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.t: F = None
        self.r: E = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.y: I = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: B = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: H = None
        self.q: G = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.t: F = None
        self.r: E = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.y: I = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: B = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: H = None
        self.q: G = None
        self.t: A = None
        self.txt = txt

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

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