class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.r: H = None
        self.x: G = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: C = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.s: B = None
        self.q: F = None
        self.txt = txt

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

i.r = g
i.x = g
i.u = e
i.v = a
g.y = c
g.p = m
g.o = l
e.v = m
c.u = m
c.p = m
c.q = f
a.v = e
a.y = m
a.r = m
a.u = m
a.x = f
n.r = f
n.t = e
n.s = m
f.p = a
f.u = m
f.o = e
m.q = g
l.r = i
l.z = i
l.s = g
l.q = n
assert c.q.p.v.v.q.y.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.r: H = None
        self.x: G = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: C = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.s: B = None
        self.q: F = None
        self.txt = txt

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

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