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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.o: B = None
        self.t: E = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
e = D("e")
m = E("m")
n = F("n")
b = G("b")

h.w = m
h.u = m
h.v = m
h.z = k
h.q = n
h.r = b
k.u = e
l.o = m
l.r = h
l.t = k
l.s = e
l.y = n
e.o = n
e.z = h
e.q = h
e.s = b
m.u = h
n.s = l
n.q = l
n.o = k
n.t = m
b.u = m
b.x = l
assert l.r.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: E = None
        self.z: B = None
        self.q: F = None
        self.r: G = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.o: B = None
        self.t: E = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
e = D("e")
m = E("m")
n = F("n")
b = G("b")

h.w = m
h.u = m
h.v = m
h.z = k
h.q = n
h.r = b
k.u = e
l.o = m
l.r = h
l.t = k
l.s = e
l.y = n
e.o = n
e.z = h
e.q = h
e.s = b
m.u = h
n.s = l
n.q = l
n.o = k
n.t = m
b.u = m
b.x = l
assert l.r.w.u.txt == "h"