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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

g = A("g")
k = B("k")
c = C("c")
d = D("d")
a = E("a")
l = F("l")
i = B("i")
h = D("h")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

g = A("g")
k = B("k")
c = C("c")
d = D("d")
a = E("a")
l = F("l")
i = B("i")
h = D("h")
f = F("f")

g.u = a
g.y = a
k.r = i
k.t = a
k.p = g
k.v = g
c.q = h
c.s = a
d.v = g
d.r = h
d.p = k
a.r = i
a.z = k
a.y = k
l.x = h
l.s = g
l.q = f
i.r = k
i.t = a
i.p = g
i.v = g
h.v = g
h.r = d
h.p = i
f.x = d
f.s = g
f.q = l
assert f.x.v.u.r.t.txt == "a"