class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.v: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

d = A("d")
g = B("g")
b = C("b")
n = D("n")
j = E("j")
a = F("a")
f = F("f")

d.x = n
d.u = n
d.t = n
d.v = j
d.q = b
g.r = f
b.s = n
b.u = d
b.w = d
b.r = j
b.t = g
n.u = g
n.r = g
n.q = g
j.s = d
j.r = d
j.y = b
j.u = g
j.w = n
a.s = b
f.s = b
assert n.q.r.s.s.u.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.v: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

d = A("d")
g = B("g")
b = C("b")
n = D("n")
j = E("j")
a = F("a")
f = F("f")

d.x = n
d.u = n
d.t = n
d.v = j
d.q = b
g.r = f
b.s = n
b.u = d
b.w = d
b.r = j
b.t = g
n.u = g
n.r = g
n.q = g
j.s = d
j.r = d
j.y = b
j.u = g
j.w = n
a.s = b
f.s = b
assert n.q.r.s.s.u.r.s.txt == "b"