class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: C = None
        self.w: G = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.x: C = None
        self.t: G = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: C = None
        self.x: F = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: A = None
        self.x: C = None
        self.t: G = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: C = None
        self.x: F = None
        self.v: G = None
        self.txt = txt

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

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