class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.q: H = None
        self.x: B = None
        self.v: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.txt = txt

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

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

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

b.r = k
b.u = c
b.q = j
b.x = n
b.v = l
b.w = h
n.v = h
l.u = f
l.t = k
l.x = k
l.o = n
l.v = c
l.y = j
f.t = k
f.v = j
k.y = h
c.o = n
c.s = f
h.r = c
h.w = n
h.y = f
j.t = n
j.r = n
j.u = c
j.x = b
j.z = k
assert c.s.v.z.y.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.q: H = None
        self.x: B = None
        self.v: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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