class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.w: C = None
        self.x: D = None
        self.txt = txt

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

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

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

m.x = l
m.p = l
m.v = f
m.t = h
l.z = m
i.w = d
i.y = j
i.z = f
f.u = l
f.y = j
f.w = i
f.x = h
g.p = j
g.o = m
d.z = m
j.p = g
j.o = m
h.u = l
h.y = g
h.w = i
h.x = f
b.u = l
b.y = j
b.w = i
b.x = f
assert d.z.p.z.v.y.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.w: C = None
        self.x: D = None
        self.txt = txt

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

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

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

m.x = l
m.p = l
m.v = f
m.t = h
l.z = m
i.w = d
i.y = j
i.z = f
f.u = l
f.y = j
f.w = i
f.x = h
g.p = j
g.o = m
d.z = m
j.p = g
j.o = m
h.u = l
h.y = g
h.w = i
h.x = f
b.u = l
b.y = j
b.w = i
b.x = f
assert d.z.p.z.v.y.p.p.txt == "j"