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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: G = None
        self.p: F = None
        self.txt = txt

b = A("b")
j = B("j")
e = C("e")
m = D("m")
h = E("h")
k = F("k")
d = G("d")
c = H("c")
a = I("a")
f = G("f")

b.v = k
b.x = k
b.p = c
b.z = m
b.t = m
b.y = j
b.o = j
b.q = j
b.s = e
j.o = b
j.w = b
j.t = b
j.q = m
e.v = d
m.s = d
h.v = e
h.q = b
h.y = j
k.s = m
k.v = m
k.y = d
k.t = j
d.o = e
c.q = e
a.s = b
a.z = f
a.p = k
f.o = e
assert a.s.p.q.v.o.v.o.v.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.x: F = None
        self.z: D = None
        self.y: B = None
        self.o: B = None
        self.t: D = None
        self.q: B = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: G = None
        self.p: F = None
        self.txt = txt

b = A("b")
j = B("j")
e = C("e")
m = D("m")
h = E("h")
k = F("k")
d = G("d")
c = H("c")
a = I("a")
f = G("f")

b.v = k
b.x = k
b.p = c
b.z = m
b.t = m
b.y = j
b.o = j
b.q = j
b.s = e
j.o = b
j.w = b
j.t = b
j.q = m
e.v = d
m.s = d
h.v = e
h.q = b
h.y = j
k.s = m
k.v = m
k.y = d
k.t = j
d.o = e
c.q = e
a.s = b
a.z = f
a.p = k
f.o = e
assert a.s.p.q.v.o.v.o.v.o.v.txt == "d"