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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: D = None
        self.y: C = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

l = A("l")
n = B("n")
h = C("h")
k = D("k")
j = E("j")
f = F("f")
g = B("g")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: D = None
        self.y: C = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

l = A("l")
n = B("n")
h = C("h")
k = D("k")
j = E("j")
f = F("f")
g = B("g")

l.s = f
l.y = k
l.w = k
l.p = k
l.u = g
l.z = g
n.v = f
n.z = l
h.o = f
h.x = f
h.u = k
h.r = k
h.w = n
k.s = h
k.t = h
k.u = f
k.q = l
k.w = n
j.p = f
f.t = n
f.p = k
f.y = h
f.r = h
f.x = h
g.v = f
g.z = l
assert l.y.q.y.u.p.txt == "k"