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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: E = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

f = A("f")
i = B("i")
n = C("n")
j = D("j")
b = E("b")
a = F("a")
h = G("h")
e = C("e")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: E = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

f = A("f")
i = B("i")
n = C("n")
j = D("j")
b = E("b")
a = F("a")
h = G("h")
e = C("e")

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