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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.w: D = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.t: E = None
        self.txt = txt

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

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

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

b = A("b")
f = B("f")
j = C("j")
m = D("m")
k = E("k")
l = F("l")
h = G("h")

b.q = j
b.u = j
b.o = k
b.s = m
b.w = l
b.y = f
f.t = h
f.s = m
f.w = m
f.y = j
j.s = f
j.t = m
m.y = k
m.t = k
m.u = l
k.v = m
k.s = j
k.q = f
k.w = f
k.t = h
l.s = j
h.v = j
h.y = j
h.p = j
h.q = b
h.z = l
assert l.s.t.u.s.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: C = None
        self.o: E = None
        self.s: D = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.w: D = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.t: E = None
        self.txt = txt

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

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

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

b = A("b")
f = B("f")
j = C("j")
m = D("m")
k = E("k")
l = F("l")
h = G("h")

b.q = j
b.u = j
b.o = k
b.s = m
b.w = l
b.y = f
f.t = h
f.s = m
f.w = m
f.y = j
j.s = f
j.t = m
m.y = k
m.t = k
m.u = l
k.v = m
k.s = j
k.q = f
k.w = f
k.t = h
l.s = j
h.v = j
h.y = j
h.p = j
h.q = b
h.z = l
assert l.s.t.u.s.t.y.txt == "k"