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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: G = None
        self.w: F = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.y: H = None
        self.q: H = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
c = C("c")
h = D("h")
n = E("n")
b = F("b")
k = G("k")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: G = None
        self.w: F = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.y: H = None
        self.q: H = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
c = C("c")
h = D("h")
n = E("n")
b = F("b")
k = G("k")
d = H("d")

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