class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.p: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.x: C = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: I = None
        self.t: H = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: I = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.p: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.x: C = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: I = None
        self.t: H = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: I = None
        self.o: I = None
        self.txt = txt

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

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

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

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