class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.u: C = None
        self.q: C = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: F = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: H = None
        self.t: F = None
        self.q: B = None
        self.p: F = None
        self.r: F = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.u: C = None
        self.q: C = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: F = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: H = None
        self.t: F = None
        self.q: B = None
        self.p: F = None
        self.r: F = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

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

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