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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.y: A = None
        self.s: A = None
        self.u: B = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

d = A("d")
k = B("k")
g = C("g")
e = D("e")
l = E("l")
b = F("b")
m = G("m")
c = E("c")
f = F("f")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.y: A = None
        self.s: A = None
        self.u: B = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

d = A("d")
k = B("k")
g = C("g")
e = D("e")
l = E("l")
b = F("b")
m = G("m")
c = E("c")
f = F("f")

d.q = e
d.z = e
d.p = k
k.t = l
k.x = m
k.p = m
g.p = k
e.t = d
l.s = k
l.o = m
l.y = g
b.p = f
b.w = k
b.u = k
b.r = k
b.t = k
b.y = d
b.s = d
m.p = k
c.s = k
c.o = m
c.y = g
f.p = b
f.w = k
f.u = k
f.r = k
f.t = k
f.y = d
f.s = d
assert k.t.s.t.o.p.t.y.p.txt == "k"