class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: C = None
        self.y: D = None
        self.q: H = None
        self.r: E = None
        self.u: G = None
        self.s: I = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: C = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: B = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: C = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: B = None
        self.r: G = None
        self.txt = txt

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

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