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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: I = None
        self.y: B = None
        self.x: G = None
        self.s: F = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.o: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.y: E = None
        self.s: G = None
        self.t: A = None
        self.q: A = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: I = None
        self.y: B = None
        self.x: G = None
        self.s: F = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.o: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.y: E = None
        self.s: G = None
        self.t: A = None
        self.q: A = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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