class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: G = None
        self.w: B = None
        self.r: C = None
        self.q: C = None
        self.u: H = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: G = None
        self.u: I = None
        self.z: C = None
        self.w: A = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.r: F = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: G = None
        self.u: I = None
        self.z: C = None
        self.w: A = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.r: F = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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