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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: E = None
        self.o: C = None
        self.q: C = None
        self.z: I = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: F = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

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

n = A("n")
j = B("j")
b = C("b")
f = D("f")
l = E("l")
g = F("g")
m = G("m")
d = H("d")
i = I("i")

n.v = d
j.o = n
b.v = g
b.u = l
b.w = j
f.y = g
f.u = g
f.o = m
l.v = n
l.z = f
g.u = f
g.p = j
g.q = j
m.r = d
m.v = l
m.o = b
m.q = b
m.z = i
m.w = f
d.y = j
d.p = j
d.s = g
d.v = n
i.r = l
i.s = f
i.x = g
i.w = b
i.z = b
assert f.y.u.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: F = None
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: E = None
        self.o: C = None
        self.q: C = None
        self.z: I = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: F = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

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

n = A("n")
j = B("j")
b = C("b")
f = D("f")
l = E("l")
g = F("g")
m = G("m")
d = H("d")
i = I("i")

n.v = d
j.o = n
b.v = g
b.u = l
b.w = j
f.y = g
f.u = g
f.o = m
l.v = n
l.z = f
g.u = f
g.p = j
g.q = j
m.r = d
m.v = l
m.o = b
m.q = b
m.z = i
m.w = f
d.y = j
d.p = j
d.s = g
d.v = n
i.r = l
i.s = f
i.x = g
i.w = b
i.z = b
assert f.y.u.y.p.txt == "j"