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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

b = A("b")
e = B("e")
d = C("d")
a = D("a")
g = E("g")
n = F("n")
j = C("j")
f = E("f")
c = C("c")
k = C("k")

b.y = a
e.v = d
d.p = e
d.x = e
d.w = g
d.s = f
a.y = n
a.x = k
g.y = j
n.o = b
n.z = j
n.w = e
n.u = c
j.p = e
j.x = e
j.w = f
j.s = f
f.y = j
c.p = e
c.x = e
c.w = g
c.s = g
k.p = e
k.x = e
k.w = g
k.s = g
assert f.y.w.y.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

b = A("b")
e = B("e")
d = C("d")
a = D("a")
g = E("g")
n = F("n")
j = C("j")
f = E("f")
c = C("c")
k = C("k")

b.y = a
e.v = d
d.p = e
d.x = e
d.w = g
d.s = f
a.y = n
a.x = k
g.y = j
n.o = b
n.z = j
n.w = e
n.u = c
j.p = e
j.x = e
j.w = f
j.s = f
f.y = j
c.p = e
c.x = e
c.w = g
c.s = g
k.p = e
k.x = e
k.w = g
k.s = g
assert f.y.w.y.x.v.txt == "d"