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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.w: D = None
        self.p: G = None
        self.z: C = None
        self.r: G = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.w: D = None
        self.p: G = None
        self.z: C = None
        self.r: G = None
        self.x: A = None
        self.txt = txt

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

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

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