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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

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

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

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

m = A("m")
g = B("g")
n = C("n")
i = D("i")
d = E("d")
b = F("b")
j = C("j")
c = F("c")
f = B("f")

m.w = g
g.x = c
g.t = d
g.v = d
g.s = i
g.p = f
g.y = f
n.y = d
n.w = m
n.u = m
n.p = c
i.x = c
i.s = j
i.q = f
i.t = n
d.v = c
d.u = c
b.y = m
b.r = m
b.s = d
j.y = d
j.w = m
j.u = m
j.p = b
c.y = m
c.r = m
c.s = d
f.x = b
f.t = d
f.v = d
f.s = i
f.p = g
f.y = g
assert f.s.s.p.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

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

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

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

m = A("m")
g = B("g")
n = C("n")
i = D("i")
d = E("d")
b = F("b")
j = C("j")
c = F("c")
f = B("f")

m.w = g
g.x = c
g.t = d
g.v = d
g.s = i
g.p = f
g.y = f
n.y = d
n.w = m
n.u = m
n.p = c
i.x = c
i.s = j
i.q = f
i.t = n
d.v = c
d.u = c
b.y = m
b.r = m
b.s = d
j.y = d
j.w = m
j.u = m
j.p = b
c.y = m
c.r = m
c.s = d
f.x = b
f.t = d
f.v = d
f.s = i
f.p = g
f.y = g
assert f.s.s.p.s.v.txt == "c"