class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.x: D = None
        self.u: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: A = None
        self.r: D = None
        self.o: C = None
        self.q: A = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.txt = txt

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

h.s = b
h.y = l
h.x = l
h.u = i
h.o = g
b.y = l
b.r = l
b.z = h
b.q = h
b.s = h
b.o = e
e.o = g
e.z = i
l.t = i
i.y = h
g.u = d
g.s = b
c.s = b
c.y = l
c.x = l
c.u = i
c.o = k
k.u = d
k.s = b
d.o = k
d.z = i
assert h.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.x: D = None
        self.u: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: A = None
        self.r: D = None
        self.o: C = None
        self.q: A = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.txt = txt

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

h.s = b
h.y = l
h.x = l
h.u = i
h.o = g
b.y = l
b.r = l
b.z = h
b.q = h
b.s = h
b.o = e
e.o = g
e.z = i
l.t = i
i.y = h
g.u = d
g.s = b
c.s = b
c.y = l
c.x = l
c.u = i
c.o = k
k.u = d
k.s = b
d.o = k
d.z = i
assert h.u.y.u.txt == "i"