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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.r: D = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.x: A = None
        self.txt = txt

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

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

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

g.s = e
g.u = e
g.x = j
e.q = j
e.t = i
e.r = l
e.y = f
e.u = g
n.x = g
n.y = l
l.r = i
l.q = g
l.x = g
b.x = l
b.r = g
b.y = f
b.p = f
i.u = e
j.x = g
j.y = l
f.x = l
f.r = g
f.y = b
f.p = b
assert i.u.y.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.r: D = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.x: A = None
        self.txt = txt

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

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

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

g.s = e
g.u = e
g.x = j
e.q = j
e.t = i
e.r = l
e.y = f
e.u = g
n.x = g
n.y = l
l.r = i
l.q = g
l.x = g
b.x = l
b.r = g
b.y = f
b.p = f
i.u = e
j.x = g
j.y = l
f.x = l
f.r = g
f.y = b
f.p = b
assert i.u.y.r.u.txt == "e"