class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: C = None
        self.txt = txt

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

c.z = h
c.x = l
c.r = b
k.p = c
k.x = n
k.s = h
d.s = l
d.v = l
d.t = n
d.p = e
d.w = f
f.p = c
f.t = n
n.t = l
l.r = f
l.t = f
l.z = k
l.p = c
l.q = c
l.w = c
b.r = f
b.x = d
e.s = l
e.v = l
e.t = n
e.p = d
e.w = f
h.p = c
h.x = n
h.s = k
assert l.t.t.t.z.p.z.x.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: C = None
        self.txt = txt

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

c.z = h
c.x = l
c.r = b
k.p = c
k.x = n
k.s = h
d.s = l
d.v = l
d.t = n
d.p = e
d.w = f
f.p = c
f.t = n
n.t = l
l.r = f
l.t = f
l.z = k
l.p = c
l.q = c
l.w = c
b.r = f
b.x = d
e.s = l
e.v = l
e.t = n
e.p = d
e.w = f
h.p = c
h.x = n
h.s = k
assert l.t.t.t.z.p.z.x.t.t.txt == "f"