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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: E = None
        self.x: B = None
        self.v: B = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
l = C("l")
d = D("d")
j = E("j")
b = F("b")
h = G("h")
n = D("n")

f.r = h
f.x = i
f.w = l
i.w = l
l.s = b
l.w = j
l.u = j
l.r = j
l.x = i
l.v = i
d.t = b
d.s = i
d.z = f
j.p = h
j.w = f
b.r = j
b.y = j
b.u = d
h.s = b
h.x = f
n.t = b
n.s = i
n.z = f
assert j.w.w.w.w.w.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: B = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: E = None
        self.x: B = None
        self.v: B = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
l = C("l")
d = D("d")
j = E("j")
b = F("b")
h = G("h")
n = D("n")

f.r = h
f.x = i
f.w = l
i.w = l
l.s = b
l.w = j
l.u = j
l.r = j
l.x = i
l.v = i
d.t = b
d.s = i
d.z = f
j.p = h
j.w = f
b.r = j
b.y = j
b.u = d
h.s = b
h.x = f
n.t = b
n.s = i
n.z = f
assert j.w.w.w.w.w.w.p.txt == "h"