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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.w: G = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.z: D = None
        self.w: D = None
        self.x: B = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: I = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.txt = txt

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

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

e.r = b
e.s = m
e.p = c
h.p = j
h.s = d
h.w = b
h.q = f
h.z = c
j.q = d
c.o = f
c.r = f
d.o = f
d.r = c
d.z = c
d.w = c
d.x = h
d.s = b
f.p = h
f.u = m
f.o = b
f.v = d
b.p = m
b.x = c
b.t = n
b.u = h
n.q = f
n.x = b
m.p = b
m.r = j
assert n.q.v.x.w.u.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: I = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.w: G = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.z: D = None
        self.w: D = None
        self.x: B = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: I = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.txt = txt

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

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

e.r = b
e.s = m
e.p = c
h.p = j
h.s = d
h.w = b
h.q = f
h.z = c
j.q = d
c.o = f
c.r = f
d.o = f
d.r = c
d.z = c
d.w = c
d.x = h
d.s = b
f.p = h
f.u = m
f.o = b
f.v = d
b.p = m
b.x = c
b.t = n
b.u = h
n.q = f
n.x = b
m.p = b
m.r = j
assert n.q.v.x.w.u.z.o.txt == "f"