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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.z: B = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

m.r = g
n.v = h
a.t = h
a.x = b
a.p = j
g.z = f
h.v = j
h.p = g
h.s = m
j.y = l
j.w = h
j.t = f
f.w = m
f.y = m
f.q = n
f.t = l
f.r = a
f.p = a
f.x = h
l.q = h
l.r = h
l.v = b
l.z = n
l.w = g
b.w = m
b.y = m
b.q = n
b.t = l
b.r = a
b.p = a
b.x = h
assert l.v.q.v.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.z: B = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

m.r = g
n.v = h
a.t = h
a.x = b
a.p = j
g.z = f
h.v = j
h.p = g
h.s = m
j.y = l
j.w = h
j.t = f
f.w = m
f.y = m
f.q = n
f.t = l
f.r = a
f.p = a
f.x = h
l.q = h
l.r = h
l.v = b
l.z = n
l.w = g
b.w = m
b.y = m
b.q = n
b.t = l
b.r = a
b.p = a
b.x = h
assert l.v.q.v.p.z.txt == "f"