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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.z: F = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.y: E = None
        self.txt = txt

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

h = A("h")
n = B("n")
f = C("f")
k = D("k")
g = E("g")
l = F("l")
d = D("d")
b = E("b")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.z: F = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.y: E = None
        self.txt = txt

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

h = A("h")
n = B("n")
f = C("f")
k = D("k")
g = E("g")
l = F("l")
d = D("d")
b = E("b")

h.u = f
h.r = f
h.s = f
h.y = f
h.x = b
n.q = l
f.y = n
k.t = h
k.u = d
k.z = l
k.x = l
k.w = n
g.t = b
g.y = b
g.w = h
l.v = n
l.r = h
l.q = f
d.t = h
d.u = k
d.z = l
d.x = l
d.w = n
b.t = g
b.y = g
b.w = h
assert b.y.w.s.y.q.v.q.q.txt == "f"