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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.s: G = None
        self.t: G = None
        self.v: A = None
        self.o: B = None
        self.u: F = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: F = None
        self.z: I = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: A = None
        self.q: F = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.y: C = None
        self.w: C = None
        self.u: C = None
        self.p: I = None
        self.z: G = None
        self.r: F = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.s: G = None
        self.t: G = None
        self.v: A = None
        self.o: B = None
        self.u: F = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: F = None
        self.z: I = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: A = None
        self.q: F = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.y: C = None
        self.w: C = None
        self.u: C = None
        self.p: I = None
        self.z: G = None
        self.r: F = None
        self.x: B = None
        self.txt = txt

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

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

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