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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: I = None
        self.x: A = None
        self.y: H = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: I = None
        self.s: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: I = None
        self.x: A = None
        self.y: H = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: I = None
        self.s: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

j.r = m
f.x = i
e.p = m
e.q = l
e.s = j
k.p = l
l.q = f
c.o = f
c.w = f
c.q = b
c.x = j
c.y = m
c.t = e
i.w = b
i.o = b
i.s = b
m.r = d
m.o = c
b.y = c
b.u = k
d.o = e
assert b.y.w.x.o.txt == "b"