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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: G = None
        self.v: C = None
        self.o: F = None
        self.w: F = None
        self.r: F = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: G = None
        self.v: C = None
        self.o: F = None
        self.w: F = None
        self.r: F = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.txt = txt

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

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