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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: C = None
        self.txt = txt

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

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

f = A("f")
i = B("i")
b = C("b")
n = D("n")
e = E("e")
l = F("l")
m = F("m")
k = F("k")
d = E("d")

f.r = n
i.v = b
i.z = n
b.x = n
b.r = n
b.s = n
b.z = k
b.p = f
b.w = i
n.y = k
n.v = b
e.t = n
l.x = e
l.z = i
l.v = m
l.w = b
l.r = b
m.x = e
m.z = i
m.v = k
m.w = b
m.r = b
k.x = e
k.z = i
k.v = l
k.w = b
k.r = b
d.t = n
assert n.y.x.t.v.w.z.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: C = None
        self.txt = txt

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

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

f = A("f")
i = B("i")
b = C("b")
n = D("n")
e = E("e")
l = F("l")
m = F("m")
k = F("k")
d = E("d")

f.r = n
i.v = b
i.z = n
b.x = n
b.r = n
b.s = n
b.z = k
b.p = f
b.w = i
n.y = k
n.v = b
e.t = n
l.x = e
l.z = i
l.v = m
l.w = b
l.r = b
m.x = e
m.z = i
m.v = k
m.w = b
m.r = b
k.x = e
k.z = i
k.v = l
k.w = b
k.r = b
d.t = n
assert n.y.x.t.v.w.z.y.x.txt == "e"