class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

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

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

l.p = e
f.o = l
f.x = l
f.r = e
f.q = h
f.z = h
f.v = b
f.u = i
k.u = h
k.x = h
k.y = h
k.w = l
k.v = i
e.t = i
e.v = i
e.x = k
e.z = k
e.s = k
e.w = k
e.u = l
i.x = f
i.w = k
h.x = i
h.u = f
h.w = e
h.p = l
b.s = k
b.y = k
b.x = e
b.u = e
b.q = i
b.o = f
assert e.u.p.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

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

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

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