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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: H = None
        self.u: D = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.u: F = None
        self.z: E = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

c = A("c")
a = B("a")
m = C("m")
l = D("l")
f = E("f")
k = F("k")
g = G("g")
e = H("e")
n = C("n")

c.p = f
c.w = e
c.u = a
a.x = g
a.y = l
m.w = a
m.p = l
l.t = k
f.t = e
f.z = e
f.u = l
f.v = a
f.x = g
k.p = g
k.s = c
g.t = a
e.r = l
e.q = l
e.s = l
e.p = a
e.u = k
e.z = f
n.w = a
n.p = l
assert f.v.x.t.x.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: H = None
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: H = None
        self.u: D = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.u: F = None
        self.z: E = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

c = A("c")
a = B("a")
m = C("m")
l = D("l")
f = E("f")
k = F("k")
g = G("g")
e = H("e")
n = C("n")

c.p = f
c.w = e
c.u = a
a.x = g
a.y = l
m.w = a
m.p = l
l.t = k
f.t = e
f.z = e
f.u = l
f.v = a
f.x = g
k.p = g
k.s = c
g.t = a
e.r = l
e.q = l
e.s = l
e.p = a
e.u = k
e.z = f
n.w = a
n.p = l
assert f.v.x.t.x.t.y.txt == "l"