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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: C = None
        self.t: D = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: C = None
        self.u: H = None
        self.s: G = None
        self.r: A = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: D = None
        self.w: G = None
        self.q: G = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.r: E = None
        self.t: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: C = None
        self.t: D = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: C = None
        self.u: H = None
        self.s: G = None
        self.r: A = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: D = None
        self.w: G = None
        self.q: G = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.r: E = None
        self.t: G = None
        self.txt = txt

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

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