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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: B = None
        self.z: D = None
        self.u: D = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

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

h.p = i
h.s = e
e.y = j
d.p = g
d.w = g
d.r = j
d.v = h
g.w = i
g.o = d
i.s = e
j.y = d
j.r = d
j.o = e
j.z = g
j.u = g
j.v = g
f.s = e
assert f.s.y.r.v.p.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: B = None
        self.z: D = None
        self.u: D = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

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

h.p = i
h.s = e
e.y = j
d.p = g
d.w = g
d.r = j
d.v = h
g.w = i
g.o = d
i.s = e
j.y = d
j.r = d
j.o = e
j.z = g
j.u = g
j.v = g
f.s = e
assert f.s.y.r.v.p.s.y.txt == "j"