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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
i = C("i")
d = D("d")
h = E("h")
c = F("c")
l = G("l")
g = F("g")
f = C("f")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
i = C("i")
d = D("d")
h = E("h")
c = F("c")
l = G("l")
g = F("g")
f = C("f")

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