class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: C = None
        self.q: A = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.p: B = None
        self.o: B = None
        self.t: C = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: C = None
        self.q: A = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.p: B = None
        self.o: B = None
        self.t: C = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

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

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

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