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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.z: E = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: A = None
        self.w: C = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

b = A("b")
e = B("e")
a = C("a")
i = D("i")
g = E("g")
h = F("h")
m = B("m")
c = F("c")

b.s = i
b.v = i
e.v = b
e.x = b
e.u = m
e.z = m
e.y = c
e.w = c
a.x = b
a.q = b
a.p = b
a.z = g
i.r = m
g.q = a
h.v = c
h.p = b
h.w = a
h.t = e
h.z = m
m.v = b
m.x = b
m.u = e
m.z = e
m.y = h
m.w = h
c.v = h
c.p = b
c.w = a
c.t = e
c.z = e
assert b.s.r.y.z.v.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.z: E = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: A = None
        self.w: C = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

b = A("b")
e = B("e")
a = C("a")
i = D("i")
g = E("g")
h = F("h")
m = B("m")
c = F("c")

b.s = i
b.v = i
e.v = b
e.x = b
e.u = m
e.z = m
e.y = c
e.w = c
a.x = b
a.q = b
a.p = b
a.z = g
i.r = m
g.q = a
h.v = c
h.p = b
h.w = a
h.t = e
h.z = m
m.v = b
m.x = b
m.u = e
m.z = e
m.y = h
m.w = h
c.v = h
c.p = b
c.w = a
c.t = e
c.z = e
assert b.s.r.y.z.v.v.r.txt == "m"