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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: D = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: D = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

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

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