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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.y: J = None
        self.w: J = None
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: G = None
        self.p: H = None
        self.u: J = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.r: D = None
        self.u: I = None
        self.w: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.y: J = None
        self.w: J = None
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: G = None
        self.p: H = None
        self.u: J = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.r: D = None
        self.u: I = None
        self.w: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: G = None
        self.txt = txt

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

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