class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: E = None
        self.w: E = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.x: E = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: F = None
        self.r: D = None
        self.x: C = None
        self.w: F = None
        self.p: E = None
        self.s: C = None
        self.txt = txt

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

f.v = b
h.u = m
h.p = i
h.w = i
h.z = f
h.s = b
a.w = g
a.r = f
g.y = h
i.u = c
i.o = f
i.r = f
c.z = h
c.s = b
c.o = b
c.y = i
c.x = i
c.w = i
c.r = m
c.v = f
m.v = h
m.s = i
m.x = i
m.q = f
m.p = a
b.q = m
b.v = c
b.w = c
b.r = g
b.x = a
b.s = a
b.p = i
assert i.u.r.v.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: E = None
        self.w: E = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.x: E = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: F = None
        self.r: D = None
        self.x: C = None
        self.w: F = None
        self.p: E = None
        self.s: C = None
        self.txt = txt

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

f.v = b
h.u = m
h.p = i
h.w = i
h.z = f
h.s = b
a.w = g
a.r = f
g.y = h
i.u = c
i.o = f
i.r = f
c.z = h
c.s = b
c.o = b
c.y = i
c.x = i
c.w = i
c.r = m
c.v = f
m.v = h
m.s = i
m.x = i
m.q = f
m.p = a
b.q = m
b.v = c
b.w = c
b.r = g
b.x = a
b.s = a
b.p = i
assert i.u.r.v.w.o.txt == "f"