class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: C = None
        self.z: I = None
        self.x: B = None
        self.q: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.q: G = None
        self.o: B = None
        self.z: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.v: I = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.q: G = None
        self.o: B = None
        self.z: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.v: I = None
        self.w: C = None
        self.txt = txt

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

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

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