class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: F = None
        self.r: B = None
        self.s: G = None
        self.y: F = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

f = A("f")
b = B("b")
h = C("h")
l = D("l")
n = E("n")
d = F("d")
i = G("i")
j = H("j")

f.r = d
f.v = n
b.t = n
b.w = n
b.o = f
h.o = f
h.u = n
h.y = b
l.p = j
l.q = j
l.u = d
l.y = d
l.r = b
l.s = i
n.z = b
d.s = b
d.x = b
d.z = b
d.o = f
d.y = f
d.p = l
d.r = j
d.u = n
i.t = n
i.v = n
i.p = d
i.y = l
i.u = l
j.x = n
assert l.s.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: F = None
        self.r: B = None
        self.s: G = None
        self.y: F = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

f = A("f")
b = B("b")
h = C("h")
l = D("l")
n = E("n")
d = F("d")
i = G("i")
j = H("j")

f.r = d
f.v = n
b.t = n
b.w = n
b.o = f
h.o = f
h.u = n
h.y = b
l.p = j
l.q = j
l.u = d
l.y = d
l.r = b
l.s = i
n.z = b
d.s = b
d.x = b
d.z = b
d.o = f
d.y = f
d.p = l
d.r = j
d.u = n
i.t = n
i.v = n
i.p = d
i.y = l
i.u = l
j.x = n
assert l.s.p.u.txt == "n"