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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.x: B = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

f = A("f")
g = B("g")
c = C("c")
e = D("e")
l = E("l")
a = F("a")
m = G("m")
j = E("j")

f.q = e
f.z = j
g.z = l
g.r = a
g.o = f
g.v = m
g.x = j
c.p = f
c.s = a
c.z = m
e.v = l
l.w = j
a.w = m
a.y = m
a.r = m
a.u = c
a.p = j
a.v = e
m.t = c
m.w = c
m.z = g
m.x = g
m.r = a
j.w = l
assert c.s.u.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.x: B = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

f = A("f")
g = B("g")
c = C("c")
e = D("e")
l = E("l")
a = F("a")
m = G("m")
j = E("j")

f.q = e
f.z = j
g.z = l
g.r = a
g.o = f
g.v = m
g.x = j
c.p = f
c.s = a
c.z = m
e.v = l
l.w = j
a.w = m
a.y = m
a.r = m
a.u = c
a.p = j
a.v = e
m.t = c
m.w = c
m.z = g
m.x = g
m.r = a
j.w = l
assert c.s.u.s.v.txt == "e"