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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.t: E = None
        self.q: B = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.v: A = None
        self.y: D = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

l = A("l")
d = B("d")
g = C("g")
a = D("a")
c = E("c")
k = F("k")
i = G("i")

l.w = a
l.v = k
l.y = c
d.w = a
g.w = l
g.r = i
g.t = c
g.o = c
g.q = d
g.x = d
a.w = d
a.x = k
a.u = c
a.v = l
c.v = d
c.z = d
c.u = k
c.w = k
c.o = a
c.t = g
k.r = i
i.r = l
i.v = l
i.u = d
i.z = d
i.y = a
i.s = a
assert d.w.v.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.t: E = None
        self.q: B = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.v: A = None
        self.y: D = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

l = A("l")
d = B("d")
g = C("g")
a = D("a")
c = E("c")
k = F("k")
i = G("i")

l.w = a
l.v = k
l.y = c
d.w = a
g.w = l
g.r = i
g.t = c
g.o = c
g.q = d
g.x = d
a.w = d
a.x = k
a.u = c
a.v = l
c.v = d
c.z = d
c.u = k
c.w = k
c.o = a
c.t = g
k.r = i
i.r = l
i.v = l
i.u = d
i.z = d
i.y = a
i.s = a
assert d.w.v.w.u.txt == "c"