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

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

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

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

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

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

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

l = A("l")
e = B("e")
f = C("f")
k = D("k")
n = E("n")
h = F("h")
d = G("d")
j = G("j")

l.v = h
l.u = j
l.p = k
l.r = k
e.w = n
f.r = e
f.q = e
f.z = k
f.t = h
f.u = n
k.y = n
k.z = n
n.w = e
h.q = f
h.x = e
h.w = l
d.u = f
d.p = h
j.u = f
j.p = h
assert j.u.t.x.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: G = None
        self.p: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

l = A("l")
e = B("e")
f = C("f")
k = D("k")
n = E("n")
h = F("h")
d = G("d")
j = G("j")

l.v = h
l.u = j
l.p = k
l.r = k
e.w = n
f.r = e
f.q = e
f.z = k
f.t = h
f.u = n
k.y = n
k.z = n
n.w = e
h.q = f
h.x = e
h.w = l
d.u = f
d.p = h
j.u = f
j.p = h
assert j.u.t.x.w.w.txt == "e"