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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.x: G = None
        self.v: F = None
        self.p: F = None
        self.u: E = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.w: D = None
        self.x: G = None
        self.y: E = None
        self.v: H = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.x: G = None
        self.v: F = None
        self.p: F = None
        self.u: E = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.w: D = None
        self.x: G = None
        self.y: E = None
        self.v: H = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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