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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: G = None
        self.v: E = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: E = None
        self.t: C = None
        self.u: E = None
        self.y: C = None
        self.o: F = None
        self.q: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: G = None
        self.v: E = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: E = None
        self.t: C = None
        self.u: E = None
        self.y: C = None
        self.o: F = None
        self.q: C = None
        self.txt = txt

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

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