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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: E = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: E = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

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