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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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