class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: E = None
        self.t: A = None
        self.w: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: D = None
        self.p: A = None
        self.y: B = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: E = None
        self.t: A = None
        self.w: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: D = None
        self.p: A = None
        self.y: B = None
        self.q: G = None
        self.txt = txt

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

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