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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

i.u = k
e.s = n
e.t = f
e.q = c
b.r = i
c.v = i
c.r = i
c.q = d
n.u = d
n.t = d
d.y = e
g.s = n
g.t = f
g.q = c
f.s = n
f.t = g
f.q = c
m.r = i
k.s = n
k.t = g
k.q = c
assert e.s.u.y.s.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

i.u = k
e.s = n
e.t = f
e.q = c
b.r = i
c.v = i
c.r = i
c.q = d
n.u = d
n.t = d
d.y = e
g.s = n
g.t = f
g.q = c
f.s = n
f.t = g
f.q = c
m.r = i
k.s = n
k.t = g
k.q = c
assert e.s.u.y.s.t.y.t.txt == "f"