class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: B = None
        self.x: H = None
        self.z: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: A = None
        self.o: G = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: A = None
        self.o: G = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: H = None
        self.txt = txt

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

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