class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: E = None
        self.t: F = None
        self.x: F = None
        self.o: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: F = None
        self.s: E = None
        self.v: D = None
        self.u: F = None
        self.txt = txt

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

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

f = A("f")
l = B("l")
h = C("h")
d = D("d")
a = E("a")
e = F("e")
m = G("m")
c = E("c")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: F = None
        self.s: E = None
        self.v: D = None
        self.u: F = None
        self.txt = txt

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

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

f = A("f")
l = B("l")
h = C("h")
d = D("d")
a = E("a")
e = F("e")
m = G("m")
c = E("c")

f.y = l
f.o = l
f.v = a
f.t = e
f.x = e
f.w = h
l.w = d
l.p = c
l.t = h
h.o = a
h.t = f
h.y = f
h.r = e
h.w = d
h.v = m
d.u = l
d.z = l
a.z = h
a.t = e
a.u = e
a.s = c
a.v = d
e.o = d
e.s = m
e.z = l
m.r = f
m.v = d
c.z = h
c.t = e
c.u = e
c.s = a
c.v = d
assert d.u.w.z.p.z.txt == "h"