class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: F = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

g.v = h
g.t = m
g.r = f
g.w = c
b.z = j
h.u = m
h.z = g
j.r = b
c.s = b
m.o = n
m.s = g
f.u = c
n.r = g
n.o = m
assert c.s.z.r.z.r.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: F = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

g.v = h
g.t = m
g.r = f
g.w = c
b.z = j
h.u = m
h.z = g
j.r = b
c.s = b
m.o = n
m.s = g
f.u = c
n.r = g
n.o = m
assert c.s.z.r.z.r.z.r.txt == "b"