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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.y: F = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.s: C = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

j = A("j")
l = B("l")
c = C("c")
k = D("k")
d = E("d")
b = F("b")
g = G("g")
e = H("e")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.y: F = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.s: C = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

j = A("j")
l = B("l")
c = C("c")
k = D("k")
d = E("d")
b = F("b")
g = G("g")
e = H("e")

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