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

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

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

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

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

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

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

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

l.w = g
l.q = a
l.u = c
c.u = i
c.v = i
a.s = c
a.t = c
a.q = g
a.x = j
a.u = j
j.t = a
j.y = a
j.z = c
j.p = i
j.q = i
j.v = i
j.x = g
g.r = c
i.t = b
i.y = b
i.q = c
b.z = j
b.p = j
b.s = l
assert i.t.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

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