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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.z: F = None
        self.u: C = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: G = None
        self.o: F = None
        self.v: F = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.z: F = None
        self.u: C = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: G = None
        self.o: F = None
        self.v: F = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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