class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.o: C = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: B = None
        self.t: F = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

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

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

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

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

b.p = e
b.v = g
b.o = j
b.t = d
l.z = g
l.w = h
j.y = h
j.t = h
j.u = l
j.w = b
j.x = b
g.z = e
e.o = l
e.w = h
d.s = e
h.s = e
assert h.s.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.o: C = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: B = None
        self.t: F = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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