class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = 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: D = None
        self.q: A = None
        self.w: C = None
        self.v: I = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: F = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = 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: D = None
        self.q: A = None
        self.w: C = None
        self.v: I = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: F = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.x: F = None
        self.txt = txt

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

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