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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: B = None
        self.p: E = None
        self.s: A = None
        self.u: B = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.r: E = None
        self.t: A = None
        self.p: C = None
        self.z: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: B = None
        self.p: E = None
        self.s: A = None
        self.u: B = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.r: E = None
        self.t: A = None
        self.p: C = None
        self.z: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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